$(document).ready(function(){
	
	$("#addApplicationForm").dialog({
		autoOpen: false,
		modal: true,
		close:function(){
			$("#applicationForm input[type='text']").val("");
		}
	});
	
	$("#addApplicationButton").click(function(){
		$("#addApplicationForm").dialog("open");
	});
	
	$("#saveButton").click(function(){
		
		$.post(getRootPath()+ "/MainMenu/fund/saveAppropriationApplication.htm",$("#applicationForm").serializeArray(),function(data){
			$("#addApplicationForm").dialog("close");
			if(data.error){
				alert(data.error);
			}else{
				$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/appropriationdApplicationHistory.htm",{"pageIndex":"1"});
				alert("添加成功");
			}
		});
	});
	
	$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/appropriationdApplicationHistory.htm",{pageIndex:1});

});


